﻿<shared:PageBase x:Class="Miris.HumanMilkAnalyser.WPF.RegistrationCodePage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:shared="clr-namespace:Miris.HumanMilkAnalyser.WPF.Shared"
      x:Name="CurrentPage"
      mc:Ignorable="d" 
      d:DesignHeight="580" d:DesignWidth="1160"
	  Title="RegistrationCodePage" Style="{StaticResource DefaultPageStyle}" 
      DataContext="{Binding RegistrationCode, Source={StaticResource Locator}}">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Skins/Storyboard/PageStoryborad.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Page.Resources>
    <Grid HorizontalAlignment="Center">
        <Grid.ColumnDefinitions>
            <!-- Back Button -->
            <ColumnDefinition Width="Auto" />
            <!-- Main Content -->
            <ColumnDefinition Width="Auto" />
            <!-- Next Button -->
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Button Margin="0,0,30,0" Width="47" Tag="/Skins/Resource/Image/Back.png" Style="{StaticResource OpacityImageButton}" Click="ButtonReturn_Click" />
        <!-- Trasparent effect Background -->
        <Border Grid.Column="1" Style="{StaticResource PageContentContainerBorder}">
            <Border Style="{StaticResource PageContentBackgroundBorder}" />
        </Border>
        <Grid Grid.Column="1" Width="1050" Height="550">
            <Grid.RowDefinitions>
                <!-- Page Title -->
                <RowDefinition Height="55" />
                <!-- Data Management Functions -->
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="注册许可" Margin="0,15,40,0" HorizontalAlignment="Center" Style="{StaticResource PageTitleTextBlock}" />
            <Grid Grid.Row="1" Margin="20,0,20,0" Height="500">
                <Grid.RowDefinitions>
                    <!-- Configuration Sections -->
                    <RowDefinition Height="Auto" />
                    <!-- Save & Cancel buttons -->
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Border Grid.RowSpan="2" Padding="20" Height="320" Style="{StaticResource OperationPortionBorder}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="120" />
                                <ColumnDefinition Width="400" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="45" />
                                <RowDefinition Height="115" />
                                <RowDefinition Height="45" />
                            </Grid.RowDefinitions>
                            <TextBlock Grid.ColumnSpan="2" Margin="0,0,0,10" Text="注册许可" Style="{StaticResource RegularTextBlock}" />
                            <TextBlock Grid.Row="1" Text="电脑编号" VerticalAlignment="Center" Style="{StaticResource WhiteTextBlock}" />
                            <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding ComputerNumber}" IsReadOnly="True" Width="300" Height="30" Style="{StaticResource InfoTextBox}" />
                            <TextBlock Grid.Row="2" Text="注册码" VerticalAlignment="Top" Style="{StaticResource WhiteTextBlock}" />
                            <TextBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Top" VerticalContentAlignment="Top" Text="{Binding RegistrationCode, UpdateSourceTrigger=PropertyChanged}" 
                                     Width="300" Height="110" TextWrapping="Wrap" FontFamily="Consolas" Style="{StaticResource InfoTextBox}" />
                            <TextBlock Grid.Row="3" Margin="0,8,0,0" VerticalAlignment="Top" Text="可用次数" Style="{StaticResource WhiteTextBlock}" />
                            <TextBlock Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" Text="{Binding AvailableAuthorisedUsage}" Width="300" Height="30" Style="{StaticResource WhiteTextBlock}" />
                        </Grid>
                    </Border>
                </Grid>
                <StackPanel Grid.Row="1" Grid.ColumnSpan="3" Orientation="Horizontal" HorizontalAlignment="Center">
                    <Button Content="保存并返回" Margin="0,0,120,0" Tag="/Skins/Resource/Image/Save.png" Style="{StaticResource NavigationButton}" Command="{Binding SaveCommand}" />
                    <Button Content="取消并返回" Tag="/Skins/Resource/Image/Cancel.png" Style="{StaticResource NavigationButton}" Click="ButtonCancel_Click" />
                </StackPanel>
            </Grid>
        </Grid>
        <Button Grid.Column="2" Margin="30,0,0,0" Width="47" Tag="/Skins/Resource/Image/Next.png" Style="{StaticResource OpacityImageButton}" Visibility="Hidden" />
    </Grid>
</shared:PageBase>
